import java.util.Arrays;

public class Test3 {
    public static int[] search(int[] array,int target) {
        for (int i = 0; i < array.length - 1; i++) {
            for (int j = i + 1; j < array.length; j++) {
                if (array[i] + array[j] == target) {
                    return new int[]{i , j};
                }

            }

        }
        return new int[]{-1 , -1};

    }

    public static void main(String[] args) {
        int[] nums = {2,7,11,15};
        int[] ret = search(nums,267);
        System.out.println(Arrays.toString(ret));
    }

}
